package com.sxhuayuan.parking.controller.admin;

import javax.annotation.Resource;

import com.sxhuayuan.parking.controller.BaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sxhuayuan.parking.compenent.web.RespMessage;
import com.sxhuayuan.parking.service.CacheService;

@RestController("adminCacheController")
@RequestMapping("/admin/cache")
public class CacheController extends BaseController {

	@Resource(name = "cacheServiceImpl")
	private CacheService cacheService;

	@RequestMapping(value = "/clear")
	public RespMessage clear() {
		cacheService.clear();
		return successResp(null);
	}

	@RequestMapping(value = "/getsize")
	public RespMessage getSize() {
		return successResp(cacheService.getCacheSize());
	}
}
